home *** CD-ROM | disk | FTP | other *** search
- #define __DLGBOX_H
-
- #ifndef __AWNDOBJ_H
- #include "awndobj.h"
- #endif
-
- class dlgboxobj:public abswndobj
- {
- int isdel;
-
- public:
-
- dlgboxobj(int isdel_ = 0)
- {
- dlg = 0;
-
- isdel = isdel_;
- }
- ~dlgboxobj()
- {
- if (isdel && dlg != 0)
- {
- MessageBox(0, "del() must be called before destruction", 0, MB_OK);
- #if 0
- del(); /* del() -> DestryWindow() -> dlgproc -> onmsg() */
- #endif
- }
- }
- void del()
- {
- if (dlg != 0)
- {
- DestroyWindow(dlg);
- }
- dlg = 0;
- }
- void setret(LRESULT r)
- {
- SetWindowLong(dlg, DWL_MSGRESULT, r);
- }
- void end(int r)
- {
- EndDialog(dlg, r);
- }
- HWND getdlg()
- {
- return dlg;
- }
- HWND getwnd()
- {
- return dlg;
- }
-
- HWND dlg;
-
- virtual BOOL onmsg(UINT msg, WPARAM wp, LPARAM lp) = 0;
-
- int go(HWND owner, int dlgid);
- int go(HWND owner, char dlgname[]);
- int create(HWND owner, int dlgid);
- int create(HWND owner, char dlgname[]);
-
-
- static int dlgtopixelx(int x);
- static int dlgtopixely(int y);
- #ifdef WIN32
- static DLGTEMPLATE *loadtmpl(char dlgname[]);
- #endif
- };
-
-